#ifndef __ecap_driver_h
#define __ecap_driver_h

// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "board.h"
#include "user.h"
#include "gpio_driver.h"
#include "timebase_10k.h"

typedef struct {
	ECAPPin_E pinNum;
	volatile int16_t ecap_startTime;
	volatile int16_t ecap_lowLevelTime;
	volatile int16_t ecap_highLevelTime;
	volatile int16_t ecap_endTime;
    volatile int16_t ecap_cycleTime;
	float ecap_dutyCycle;
}ecap_data_T;

void USER_InitECAP(void);
float get_ecapDutyCycle(ECAPPin_E Pin_Name);
uint16_t get_ecapDutyCycleFix(ECAPPin_E Pin_Name);
int16_t get_ecapCycleTime(ECAPPin_E Pin_Name);

void startAllEcap(void);
void stopAllEcap(void);

__interrupt void ecap1ISR(void);
__interrupt void ecap2ISR(void);
__interrupt void ecap3ISR(void);


#endif
